package org.domain.sigerec.entity;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import org.domain.sigerec.enums.TipoClasseEnum;

@Entity
public class Cabine implements Serializable {
	
	private static final long serialVersionUID = -2226617155154412058L;
	private Long id;
	private Long numero;
	private TipoClasseEnum tipoClasse;
	private Navio navio;
	
	public Cabine() {
		
	}
	
	@Id @GeneratedValue
	public Long getId() {
	     return id;
	}

	public void setId(Long id) {
	     this.id = id;
	}

	public Long getNumero() {
		return numero;
	}

	public void setNumero(Long numero) {
		this.numero = numero;
	}

	@Enumerated(EnumType.ORDINAL)
	public TipoClasseEnum getTipoClasse() {
		return tipoClasse;
	}

	public void setTipoClasse(TipoClasseEnum classe) {
		this.tipoClasse = classe;
	}

	public void setNavio(Navio navio) {
		this.navio = navio;
	}

	@ManyToOne(cascade=CascadeType.MERGE)
	@JoinColumn(name = "navio_id")
	public Navio getNavio() {
		return navio;
	}

}